package serveur;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public class Flux {

	public static String lecture(DataInputStream in) throws IOException{
		int taille=in.readInt();
		byte message[]=new byte[taille];
		in.read(message,0,taille);
		return new String(message);
	}

	public static void ecriture(DataOutputStream out, String s) throws IOException{
		byte message[]=s.getBytes();
		out.writeInt(message.length);
		out.write(message);
	}
}
